interface IUserFriendlyException {
  message: string;
  code?: string;
  details?: object;
}

class UserFriendlyException implements IUserFriendlyException {
  message: string;
  code?: string;
  details?: object;

  constructor(message: string, code?: string, details?: object) {
    this.message = message;
    this.code = code;
    this.details = details;
  }

  static createDefaultException(message: string) {
    return new UserFriendlyException(message, undefined, undefined);
  }

  static createException(message: string, code: string, details: object) {
    return new UserFriendlyException(message, code, details);
  }
}

export type { IUserFriendlyException };
export { UserFriendlyException };
